<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="imports.jsp" %>
<html>

<head>

				 			<script type="text/javascript">


function confirmation(id,genre) {
	var answer = confirm("Voulez-vous supprimer "+genre+" ?");
	if (answer){
		alert(genre+" supprimé");
		window.location = "ModifGenre?act=del&id="+id+"";
	}
}



</script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" media="screen" type="text/css" title="style" href="style.css"/>
	<title>Super mega site d'e-commerce de livres</title>
</head>
<body>
<c:if test="${sessionUser.role != 'ADMIN'}">
   <jsp:forward page="/m" />
</c:if>
<div id="wrapper">
	<div id="header">
		<div id="logo">
		<h1>e-commerce de livres</h1>
		
			
		</div>
		
	</div>
	<!-- end #header -->
	<div id="menu">
			<jsp:include page="header.jsp"/>
	</div>
	<!-- end #menu -->
	<div id="page">
	<div id="page-bgtop">
	<div id="page-bgbtm">
	
	
		<div id="content">
		
			<div class="post">
				<h2 class="title">Liste utilisateurs</h2>
				<div class="entry">
				<form method="post" action="ModifGenre">
				<table style="width: 100%;padding-left: 150px; padding-top: 5px" >
				<tr>
					<th style="width: 40px;">id</th>
					<th style="width: 70px;">Genre</th>
				 	<th style="width: 30px;"></th>
				 </tr>	
						<c:forEach var="genre" items="${genres}">

						<tr>
							<td style="width: 40px;"> ${genre.id}	</td>
							<td style="width: 70px;"> <input type="text" name="genreId${genre.id}" size="20" maxlength="40" value="${genre.genre}"/></td>
						 	<td style="width: 30px;"></a>&nbsp;&nbsp;<a onclick="confirmation('${genre.id}','${genre.genre}')" href=""><img src="images/style/supprimer.png"></a></td>
						</tr>

						</c:forEach>
					</table>
					<br />
						<input type="submit" name="submit" value="Enregistrer" />
						<input type="submit" name="submit" value="Annuler" />
					</form>
					</div>
					
					
			</div>
			
		<div style="clear: both;">&nbsp;</div>
		</div>
		<!-- end #content -->
		<div id="sidebar">
			<ul>
				<jsp:include page="admin.jsp"/>
				<jsp:include page="categories.jsp"/>
			</ul>
		</div>
		<!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	</div>
	<!-- end #page -->
</div>
	<div id="footer">
		<p>Copyright (c) 2011. All rights reserved.</p>
	</div>
	<!-- end #footer -->

</body>
</html>

